package com.earthea.application.system.domain.transfer;

import com.earthea.application.common.core.domain.model.LoginUser;
import com.earthea.application.system.domain.entity.SysUserOnline;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface SysTransfer {
    SysTransfer INSTANCE = Mappers.getMapper(SysTransfer.class);

    @Mapping(source = "token", target = "tokenId")
    @Mapping(source = "username", target = "userName")
    @Mapping(source = "user.user.dept.deptName", target = "deptName")
    SysUserOnline toSysUserOnline(LoginUser user);
}
